package org.chnxi.study.springcloud.dubbo.order.controller;

import org.chnxi.study.springcloud.dubbo.storage.dto.StorageDto;
import org.chnxi.study.springcloud.dubbo.storage.service.IStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController extends  BaseController<IStorageService> {

//    @Autowired
//    IStorageService storageService;

    @GetMapping("/order/test")
    public String test(){
        StorageDto storageDto = new StorageDto();
        storageDto.setProductId(1);
        storageDto.setActionType(2);
        storageDto.setCount(3);
        storageDto = super.getDubboService().buy(storageDto);
//        storageDto = storageService.buy(storageDto);
        return storageDto.toString();
    }

}
